from django.urls import path
from rest_framework.routers import DefaultRouter

from polls.views import praise_or_bad, login, logout, captcha, get_mobile_code, \
    register, checkName, show_index, SubjectViewSet, TeacherViewSet

urlpatterns = [
    path('', show_index),

    # path('subjects/',show_subjects),
    # path('teacher/',show_teacher),


    path('praise/',praise_or_bad),
    path('badReview/',praise_or_bad),
    path('login/',login),
    path('logout/',logout),
    path('register/',register),
    path('captcha/',captcha),
    path('mcode/',get_mobile_code),
    path('checkName/',checkName),



]

# 定义路由器
router = DefaultRouter()
# 注册
router.register('subjects', SubjectViewSet)
router.register('teacher', TeacherViewSet)
# 添加
urlpatterns += router.urls
